New Functions in Week 2

lm

{stats}

Fit linear models using least squares

as.data.frame

{base}

Functions to check if an object is a data frame, or coerce it if possible.

as.character

{base}

Coerce a vector to character

ifelse

{base}

Return a or b depending on the value of test

which

{base}

return indexes of TRUE entries of a logical vector

sample

{base}

Takes a sample of the specified size

log

{base}

log (default base = e)

bar

{base}

Used for annotations, such as “expression(paste(”-“,bar(y)))”

subset

{base}

Return subsets of vectors, matrices or data frames which meet conditions.

nobs

{stats}

Return the number of observations in a model object

data.frame

{base}

Create a data.frame from vectors

expression

{base}

Used in plots to add symbols to axes

rnorm

{base}

Generate random numbers from a normal distribution

The end!